package com.hm.main;

import java.util.Map;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import com.hm.two.XiaoMing;
import com.hm.two.workconfig;

public class Main {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		ApplicationContext  ac =new AnnotationConfigApplicationContext(workconfig.class);
		Map<String, XiaoMing> type = ac.getBeansOfType(XiaoMing.class);
		System.out.println(type);
		
		XiaoMing bean = ac.getBean(XiaoMing.class);
		System.out.println(bean);
		
		XiaoMing bean2 = (XiaoMing) ac.getBean("xiaoMing");
		System.out.println(bean2);
		
		
	}

}
